feat(queue): connection-only GH event hand-off to chittyagent-dispatch [INERT]#252
feat(queue): connection-only GH event hand-off to chittyagent-dispatch [INERT]#252chitcommit wants to merge 2 commits into
Conversation
…patch At the 'MCP bus dispatch deferred to v3' seam in processEvent, forward the normalized event to the routing layer (chittyagent-dispatch) for the PR-shaped event types: pull_request, pull_request_review, pull_request_review_thread, check_suite, check_run. CONNECTION layer only — no maintainer or Linear logic here. ChittyConnect owns the GitHub App, HMAC verify, App token, and webhook receipt; it only hands off. Reaches dispatch via the AGENT_DISPATCH service binding if present, else fetches DISPATCH_URL (default https://dispatch.chitty.cc) using the existing X-Webhook-* header style (incl. INTERNAL_WEBHOOK_SECRET when set). Fail-safe: the webhook is already fast-acked, so the hand-off never throws — it logs and continues. Inert until the AGENT_DISPATCH binding or DISPATCH_URL is configured. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ❌ Deployment failed View logs |
chittyconnect | 6244511 | Jun 16 2026, 04:46 PM |
|
Warning Review limit reached
More reviews will be available in 51 minutes. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
Pull request overview
Adds a connection-layer “hand-off” from the GitHub event queue consumer to chittyagent-dispatch, forwarding only a scoped set of PR-lifecycle GitHub event types while keeping existing v1 automations intact.
Changes:
- Calls
forwardToDispatch(env, event, mcpEvent)immediately afternormalizeGitHubEvent()inprocessEvent. - Introduces
DISPATCH_EVENT_TYPESallowlist for which GitHub events are forwarded. - Implements
forwardToDispatch()to POST the normalized MCP event to dispatch viaAGENT_DISPATCHbinding when available, otherwise viaDISPATCH_URL(defaulting tohttps://dispatch.chitty.cc), and logs outcomes without throwing.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…dispatch hand-off Address Copilot review on PR #252: - add AbortSignal.timeout(5s) to both binding and fetch dispatch calls so a hung dispatch can't stall the queue consumer and back up v1 automations - only forward X-Webhook-Secret to trusted hosts (*.chitty.cc / localhost) on the DISPATCH_URL fallback path, so a misconfigured URL can't leak the shared internal secret; binding path stays trusted - compute transport label from the same predicate as the request branch so the log can't claim "binding" while actually using the fetch fallback Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Layer 1 — ChittyConnect: connection-only hand-off to chittyagent-dispatch
Part of the GitHub-event -> dispatch -> {gh_maintainer, linear_sync} fan-out wiring. This is the CONNECTION layer. ChittyConnect owns the GitHub App, HMAC verify, App token, and webhook receipt — and nothing else. It only hands off the normalized event to the routing layer.
What changed
src/handlers/queue.js,processEvent: at the existingMCP bus dispatch deferred to v3seam (right afternormalizeGitHubEvent), added a call to a newforwardToDispatch(env, event, mcpEvent).forwardToDispatchforwards the normalized event to chittyagent-dispatch for the PR-shaped event types only:pull_request,pull_request_review,pull_request_review_thread,check_suite,check_run(setDISPATCH_EVENT_TYPES).AGENT_DISPATCHservice binding if present; elsefetch(${DISPATCH_URL || 'https://dispatch.chitty.cc'}/dispatch/github`)`. Mirrorswebhook-router.jsheader style (X-Webhook-Source: github,X-Webhook-Timestamp,X-Forwarded-By, andX-Webhook-SecretfromINTERNAL_WEBHOOK_SECRETwhen set).webhook-router.jsAGENTS map left asgithub: null(GH is handled via this queue hand-off) — read for house style only, unchanged.Deploy prerequisites (NOT set here — no fabricated values)
AGENT_DISPATCHservice binding tochittyagent-dispatchorDISPATCH_URLvar (defaulthttps://dispatch.chitty.cc).INTERNAL_WEBHOOK_SECRET(already an existing var; included when present).Inert until wired
Until
AGENT_DISPATCH/DISPATCH_URLresolves to a deployed dispatcher with the fan-out route, the hand-off is a no-op-on-failure (logs + continues). Nothing is deployed by this PR.Validation
node --check src/handlers/queue.js— pass.Follow-up (NOT this PR)
Separation-of-concerns note
The one routing-ish decision in this connection layer is
DISPATCH_EVENT_TYPES(which event types to forward). Defensible — the operator explicitly scoped Layer 1 to these five — but flagged honestly as the place SoC was closest to the line.🤖 Generated with Claude Code